﻿<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>

<head>
	<meta charset="UTF-8">
	<title>文化服务</title>
	<meta name="page-view-size" content="1280*720">
	<link rel="stylesheet" href="css/base.css">
	<link rel="stylesheet" href="css/Z-OrderList.css">
	<script type="text/javascript" src="lib/js/evm.js"></script>
	<script type="text/javascript" src="lib/js/Evm_djyw.js"></script>
	<script type="text/javascript" src="lib/js/key.js"></script>
	<script src="lib/js/md5.js" type="text/javascript" charset="utf-8"></script>
	<script src="lib/js/jquery-1.11.1.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="lib/js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/api.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/public.js" type="text/javascript" charset="utf-8"></script>

	<script src="js/model.js"></script>

</head>

<body>
	<div class="theoretical-bg" id="helpMain">

		<div id="headerTitle" class="headerTitle"></div>

		<div class="containBar">
			<div class="shareContain" id="myShareBody">
				<div class="leftBar">
					<ul class="btnsBar" id="btnsBar">
						<!-- 左侧按钮 -->
					</ul>
				</div>

				<div class="adimg">
					<img id="adimg" src="/images/xmkimg.png" alt="">
				</div>
				<div class="menuBar" id="menuBar">
					<ul class="menuList" id="menuContent">

					</ul>
				</div>

				<div class="rightBar" id="rightBar">
					<!-- 我的技能 -->
					<div class="rightSkill" id="rightSkill">
						<div class="skillBar" id="skill">
							<!-- 技能模块 -->
						</div>
					</div>
					<p class="pageShow"><span id="now_page">1</span>/<span id="total_page">1</span></p>
				</div>

			</div>

		</div>
		<div class="scoreBox">积分：100分</div>
	</div>
</body>

<script>
	var areaName = '';
	var modelIndex = {
		menuIndex: 0,
		disUser: false, //显示头像
		index: 0, //导航栏初始位置
		menuPageSize: 6, //导航栏模块数量
		pageSize: 1, //主模块数量
		type: '',
		structure: 2, //上下结构  默认1是左右，2是上下结构
		menuContainerId: 'btnsBar', //包含导航栏模块的标签id
		menuListName: 'leftBtn', //导航栏模块名称class
		mainContainerId: 'skill', //包含主模块的标签id
		mainlistName: '', //主模块名称
		thisContain: 'rightListBar', //翻滚外容器
		thisDetail: 'rightList', //翻滚内容
		api: "getArticleList", //默认接口类型
		status: 1,
		category: 0,
		is_volunteer: 0,
		is_menu: 0,
		define: ''
	}
	var articleRun;
	var sourceName = TV.GetParam("model")
	var leftData = dataIndex[sourceName];

	var muenListData = [{
		name: '一月',
		id: '1'
	}, ];


	function getMenus(page, number) {
		if (typeof number == 'number') {
			//				modelIndex.mainContainerId = leftData[number].list_name;
		}
		left.paint(page, number);

		var widthpx = (1185 / leftData.length)
		$(".leftBtn").css("width", widthpx + "px")
	}

	function getMessage(id, page, pos, index, type) { //id,类型，页码，上下页，位置
		// is_menu = false;
		detailone = false;

		{
			var params = {
				page: page,
				pagesize: modelIndex.pageSize,
			}
			if (id == 3) {
				var params = {
					page: page,
					pagesize: modelIndex.pageSize,
					status: 3
				}
				$("#adimg").attr("src", "/images/adimg.png")
			} else {
				if (id == 0) {
					$("#adimg").attr("src", "/images/gxhimg.png")
				} else {
					$("#adimg").attr("src", "/images/xmkimg.png")
				}

			}

		}

		runState = false;

		GetDatas(modelIndex.api, params, function (err, data) {
			if (data.code == 10002 || data.code == 401) { //貌似是提示未登录
				TV.PromptMsg("您未登录或已过期，请登陆");
				setTimeout(function () {
					// window.location.href = "login.html"
				}, 3000)
			} else {
				var dataItems = [];
				for (var i = 0; i < data.data.items.length; i++) {
					var v = data.data.items[i]
					dataItems.push({
						id: v.cur_period || v.id,
						video_path: v.video_path,
						tpe: v.tpe_name || v.tpe || "暂无",
						content: v.content || v.title,
						name: v.username || v.contact||v.name||"匿名用户",
						time: v.addtime || v.add_time || v.format_add_time || v.service_time||v.format_addtime,
						img: v.img,
						title: v.title,
						status:  v.service_status||v.status,
						score: v.integral || v.scores || v.appraise,
						add: v.address ? v.address : v.brief,
						tag: v.tag || v.group || v.origin,
						service_object: v.service_object,
						phone: v.phone || v.mobile,
					})
				}

				console.log(dataItems)

				var str = '';
				if (modelIndex.mainlistName == "list-piece") {
					runState = false;
					if (dataItems.length) {
						for (var i = 0; i < dataItems.length; i++) {
							str += '<div class=' + modelIndex.mainlistName + ' data-id=' + dataItems[i].id + '>';

							str += '<div class="piece-title">'
							str += dataItems[i].title
							str += '</div>'

							str += '<div class="piece-itme">'
							str += '<div class="piece-tpe">'
							str += dataItems[i].tpe
							str += '</div>'
							str += '<div class="piece-time">'
							str += dataItems[i].time
							str += '</div>'
							str += '<div class="piece-obj">'
							str += dataItems[i].service_object
							str += '</div>'
							str += '</div>'

							str += '<div class="piece-people">'

							str += '<div class="people-name">'
							str += '<img class="people-img" src="/images/headimg.png">'
							str += dataItems[i].name
							str += '</div>'
							str += '<div class="people-phone">'
							str += '<img class="people-img"src="/images/phoneimg.png">'
							str += dataItems[i].phone
							str += '</div>'
							str += '<div class="people-group">'
							str += '<img class="people-img" src="/images/groupimg.png">'
							str += dataItems[i].tag
							str += '</div>'
							str += '</div>'

							str += '<div class="piece-btn">点单</div>'
							str += '</div>'
						}
						$('.pageShow').css('display', 'block');
						$('#now_page').html(page)
					} else {
						if (params.cid == 9999) {
							str += '<div class="noneData">';
							str += '<img src=images/erweima.png>';
							str += '</div>';
						} else {
							str += '<div class="noneData">';
							str += '<img src=images/no.png>';
							str += '</div>';
						}
						$('.pageShow').css('display', 'none');
					}
				} else if (modelIndex.mainlistName == "list-help") {
					runState = false;
					if (dataItems.length) {
						for (var i = 0; i < dataItems.length; i++) {
							str += '<div class=' + modelIndex.mainlistName + ' data-id=' + dataItems[i].id + '>';
							str += '<div class="help-title">'
							str += dataItems[i].content
							str += '</div>'
							str += '<div class="help-time">'
							str += dataItems[i].time
							str += '</div>'

							str += '<div class="help-people">'
							str += '<div class="help-name">'
							str += '<img class="help-img" src="/images/headimg.png">'
							str += dataItems[i].name
							str += '</div>'
							if (id == 0) {

								str += '<div class="help-phone">'
								str += '<img class="help-img"src="/images/phoneimg.png">'
								str += dataItems[i].phone
								str += '</div>'
							}

							str += '<div class="help-group">'
							str += '<img class="help-img" src="/images/groupimg.png">'
							str += dataItems[i].tag
							str += '</div>'

							if (id == 3) {
								str += '<div class="help-name">评价: '
								for (var z = 0; z < dataItems[i].score; z++) {
									str += '<img class="people-img" src="/images/star.png">'
								}
								for (var z = 0; z < (5 - dataItems[i].score); z++) {
									str += '<img class="people-img" src="/images/stars.png">'
								}
								str += '</div>'

							}

							str += '</div>'

							str += '<div class="help-status">'
							switch (dataItems[i].status) {
								case 0:
									str += "点单中"

									break;
								case 1:
									str += "帮助中"

									break;
								case 2:
									str += "帮助完成"

									break;
								case 3:
									str += "已评价"

									break;
								case 4:
									str += "关闭"

									break;

							}
							str += '</div>'

							str += '</div>'
						}
						$('.pageShow').css('display', 'block');
						$('#now_page').html(page)
					} else {
						if (params.cid == 9999) {
							str += '<div class="noneData">';
							str += '<img src=images/erweima.png>';
							str += '</div>';
						} else {
							str += '<div class="noneData">';
							str += '<img src=images/no.png>';
							str += '</div>';
						}
						$('.pageShow').css('display', 'none');
					}
				}

				$('#' + modelIndex.mainContainerId).html(str);
				MessOpt(page, data.data.totalpage, pos, index, 'run', 'dataMess');
			}
		})
	}

	function direEnter(status, id, index) {
		if (modelIndex.api == "orderList") { //实践点单
			GetDatas('orderSure', {
				period_id: $('.active').attr('data-id'),
				token: $.cookie('TV_CST_TOKEN'),
			}, function (err, res) {
				console.log(res)
				if (res.code == 0) {
					TV.PromptMsg('点单成功')
				} else if (res.code == 401) {
					var message = res.message
					TV.PromptMsg(message)
					setTimeout(function () {
						window.location.href = './login.html';
					}, 2500)
				} else {
					var message = res.message
					TV.PromptMsg(message)
				}
			})
		} else if (modelIndex.api == "helpList") { //详情页
			window.location.href = './helpDetail.html?id=' + $('.active').attr('data-id')
		} else {}
	}
</script>
<script type="text/javascript" src="./js/twoPageList.js"></script>

</html>